package com.easy.iot;

import org.eclipse.paho.client.mqttv3.IMqttMessageListener;
import org.eclipse.paho.client.mqttv3.MqttMessage;

/**
 * @Packge com.easy.iot
 * @Autor naibin.lin
 * @Description
 * @Version 1.0
 * @Date 2022-08-08 16:58
 */
public class MessageListener implements IMqttMessageListener {
    @Override
    public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
        System.out.println(String.format("MQTT: 订阅主题[%s]发来消息[%s]", topic, new String(mqttMessage.getPayload())));
    }
}
